<?php
include '../class/control.php';
include '../db/sql.php';
$show_content = new \control_function\ContentControl();
$show_content->get_user_id($_COOKIE['user_id']);
if($_POST['my_suggest'] == 1){
    $show_content->MySuggest_ShowSearchResult($db,$_POST['my_suggest_key_words']);
    unset($_POST['my_suggest_key_words']);
    unset($_POST['my_suggest']);
}
if($_POST['my_impl'] == 1){
    $show_content->MyImpl_ShowSearchResult($db,$_POST['my_impl_key_words']);
    unset($_POST['my_impl_key_words']);
    unset($_POST['my_impl']);
}
if($_POST['ci'] == 1){
    $show_content->CI_ShowSearchResult($db,$_POST['ci_key_words']);
    unset($_POST['ci_key_words']);
    unset($_POST['ci']);
}
if($_POST['auditor'] == 1){
    $show_content->Auditor_ShowSearchResult($db,$_POST['auditor_key_words']);
    unset($_POST['auditor_key_words']);
    unset($_POST['auditor']);
}
if($_POST['show_all'] == 1){
    if($_POST['start_date'] == null || $_POST['end_date'] == null){
        $show_content->get_start_date(null);
        $show_content->get_end_date(null);
    }
    else{
        $show_content->get_start_date($_POST['start_date']);
        $show_content->get_end_date($_POST['end_date']);
    }
    $show_content->ShowAll($db,$_POST['show_all_key_words'],$_POST['state'],$_POST['department']);
    unset($_POST['show_all_key_words']);
    unset($_POST['show_all']);
    unset($_POST['start_date']);
    unset($_POST['end_date']);
    unset($_POST['state']);
    unset($_POST['department']);
}

echo "
<script>

        
    select_tr();
    state_style();
</script>
";
?>